package cn.icare.cms;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import tk.mybatis.spring.annotation.MapperScan;

@MapperScan(basePackages = "cn.icare.cms.dao.mapper")
@SpringBootApplication
@ServletComponentScan //开启注解自动注册,如@Controller,@Commpent注解的类自动注册的启动服务中
@EnableEurekaClient //设置为EurekaClient客户端
@EnableFeignClients //启动负载均衡功能,调用其它EurekaClient客户端服务功能
@EnableHystrix //开启熔错器功能
@EnableAsync //开启异步方法
@EnableScheduling //开启定时任务功能
public class AppMiniApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(AppMiniApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AppMiniApplication.class);
    }
}
